/* GUI CONVERTED from eccnv01.p (converter v1.76) Tue Dec 31 10:45:04 2002 */
/* eccnv01.p - PCO REVISION LEVEL INITIALIZATION UTILITY                  */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                    */
/* All rights reserved worldwide.  This is an unpublished work.           */
/* $Revision: 1.7.1.5 $                                                       */
/*V8:ConvertMode=Maintenance                                              */
/* REVISION: 7.4      LAST MODIFIED: 06/29/93   BY: pma *H013*            */
/* REVISION: 7.4      LAST MODIFIED: 02/22/96   BY: rvw *H0JT*            */
/* REVISION: 8.6      LAST MODIFIED: 07/02/97   BY: Joe Gawel   *K0FV*    */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane      */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan     */
/* REVISION: 8.6E     LAST MODIFIED: 09/04/98   BY: *J2YS* Santhosh Nair  */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan     */
/* REVISION: 9.1      LAST MODIFIED: 07/11/00   BY: *N0FJ* Mudit Mehta    */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0KW* Jacolyn Neder  */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.7.1.5 $   BY: Katie Hilbert         DATE: 12/27/02  ECO: *P0L8*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}
{gplabel.i}

define input parameter part like pt_part.
define input parameter part1 like pt_part.
define output parameter yn like mfc_logical.

define variable titl like ecm_title.
define variable nbr  like ecm_nbr  initial "*000000*".
define variable name like ecm_name initial "QAD".

/* Initialize PCOs to current revision level */
{pxmsg.i &MSGNUM=2152 &ERRORLEVEL=1 &MSGBUFFER=titl}

do transaction:
   find ecm_mstr no-lock where ecm_nbr = nbr no-error.
   if not available ecm_mstr then do:
      create ecm_mstr.
      assign
         ecm_nbr        = nbr
         ecm_approval   = name
         ecm_init       = name
         ecm_name       = name
         ecm_end_date   = today
         ecm_close_date = today
         ecm_date       = today
         ecm_eff_date   = today
         ecm_man_date   = today
         ecm_open_date  = today
         ecm_rel_date   = today
         ecm_sub_date   = today
         ecm_title      = titl.
   end.
end.

yn = no.
{gprun.i ""gpistran.p"" "(input 1, input ""eccnv01.p"")"}
/*GUI*/ if global-beam-me-up then undo, leave.

for each pt_mstr no-lock
   where pt_part >= part and pt_part <= part1
break by pt_part:
   if (not can-find(first ecd_det where ecd_part = pt_part))
      and pt_rev <> ""
   then do:
      create ecd_det.
      assign
         ecd_nbr     = nbr
         ecd_part    = pt_part
         ecd_new     = yes
         ecd_start   = today
         ecd_old_rev = ""
         ecd_new_rev = pt_rev.

   end.

   if last(pt_part) then yn = yes.
end.
